<template>
    <div id="single">
        <div class="search-wrap">
            <div class="center">
                <search/>
            </div>           
        </div>   
        <div class="single-content center">
            <div class="slider-bar fl">
                <h2 class="single-title">
                    分类
                </h2>
                <el-menu
                    default-active="2"
                    class="el-menu-vertical-demo"
                    @open="handleOpen"
                    @close="handleClose">
                    <el-submenu index="1">
                        <template slot="title">
                            <span>销售系统</span>
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="1-1">选项1</el-menu-item>
                            <el-menu-item index="1-2">选项2</el-menu-item>
                        </el-menu-item-group>
                        <el-menu-item-group>
                            <el-menu-item index="1-3">选项3</el-menu-item>
                        </el-menu-item-group>
                         <el-submenu index="1-4">
                            <template slot="title">选项4</template>
                            <el-menu-item index="1-4-1">选项1</el-menu-item>
                        </el-submenu>
                                        
                    </el-submenu>
                    <el-submenu index="2">
                        <template slot="title">
                            <span>销售系统</span>
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="2-1">选项1</el-menu-item>
                            <el-menu-item index="2-2">选项2</el-menu-item>
                        </el-menu-item-group>
                        <el-menu-item-group>
                            <el-menu-item index="2-3">选项3</el-menu-item>
                        </el-menu-item-group>
                         <el-submenu index="2-4">
                            <template slot="title">选项4</template>
                            <el-menu-item index="2-4-1">选项1</el-menu-item>
                        </el-submenu>                            
                    </el-submenu>

                    <el-menu-item index="3">
                        <span slot="title">销售系统</span>
                    </el-menu-item>
                    <el-menu-item index="4">
                        <span slot="title">赛词</span>
                    </el-menu-item>
                </el-menu>
                <!-- <el-menu>
                    <label v-for="(navMenu,index) in navMenus">
                        <el-menu-item v-if="navMenu.childs==null&&navMenu.entity&&navMenu.entity.state==='ENABLE'"  
                                        :key="navMenu.entity.id" :data="navMenu" :index="navMenu.entity.name" :route="navMenu.entity.value"  
                                        disabled="">  
                            <i :class="navMenu.entity.icon"></i>  
                            <span slot="title">{{navMenu.entity.alias}}</span>  
                        </el-menu-item>  
                    
                        <el-submenu v-if="navMenu.childs&&navMenu.entity&&navMenu.entity.state==='ENABLE'"  
                                    :key="navMenu.entity.id" :data="navMenu" :index="navMenu.entity.name">  
                            <template slot="title">  
                            <i :class="navMenu.entity.icon"></i>  
                            <span> {{navMenu.entity.alias}}</span>  
                            </template>  
                            <NavMenu :navMenus="navMenu.childs"></NavMenu>  
                        </el-submenu>  
                    </label>
                </el-menu> -->
            </div>
            <router-view></router-view>
        </div>       
    </div>
</template>
<script>
//单个问题页面
import Search from '@/base/search/search'
export default {
    name:"Question",  
    data(){
        return {
            // id:this.$router.params.id
            navMenus:{  
                "entity": null,  
                "childs": [  
                    {  
                        "entity": {  
                            "id": 1,  
                            "parentMenuId": 0,  
                            "name": "systemManage",  
                            "icon": "el-icon-message\r\n",  
                            "alias": "系统管理",  
                            "state": "ENABLE",  
                            "sort": 0,  
                            "value": null,  
                            "type": "NONE",  
                            "discription": "用于系统管理的菜单",  
                            "createUserId": 1  
                        },  
                        "childs": [  
                            {  
                                "entity": {  
                                    "id": 3,  
                                    "parentMenuId": 1,  
                                    "name": "authManage",  
                                    "icon": "el-icon-loading",  
                                    "alias": "权限管理",  
                                    "state": "ENABLE",  
                                    "sort": 0,  
                                    "value": "/system/auth",  
                                    "type": "LINK",  
                                    "discription": "用于权限管理的菜单",  
                                    "createUserId": 1  
                                },  
                                "childs": null  
                            },  
                            {  
                                "entity": {  
                                    "id": 4,  
                                    "parentMenuId": 1,  
                                    "name": "roleManage",  
                                    "icon": "el-icon-bell",  
                                    "alias": "角色管理",  
                                    "state": "ENABLE",  
                                    "sort": 1,  
                                    "value": "/system/role",  
                                    "type": "LINK",  
                                    "discription": "用于角色管理的菜单",  
                                    "createUserId": 1  
                                },  
                                "childs": null  
                            },  
                            {  
                                "entity": {  
                                    "id": 2,  
                                    "parentMenuId": 1,  
                                    "name": "menuManage",  
                                    "icon": "el-icon-edit",  
                                    "alias": "菜单管理",  
                                    "state": "ENABLE",  
                                    "sort": 2,  
                                    "value": "/system/menu",  
                                    "type": "LINK",  
                                    "discription": "用于菜单管理的菜单",  
                                    "createUserId": 1  
                                },  
                                "childs": null  
                            },  
                            {  
                                "entity": {  
                                    "id": 5,  
                                    "parentMenuId": 1,  
                                    "name": "groupManage",  
                                    "icon": "el-icon-mobile-phone\r\n",  
                                    "alias": "分组管理",  
                                    "state": "ENABLE",  
                                    "sort": 3,  
                                    "value": "/system/group",  
                                    "type": "LINK",  
                                    "discription": "用于分组管理的菜单",  
                                    "createUserId": 1  
                                },  
                                "childs": null  
                            }  
                        ]  
                    },  
                    {  
                        "entity": {  
                            "id": 6,  
                            "parentMenuId": 0,  
                            "name": "userManage",  
                            "icon": "el-icon-news",  
                            "alias": "用户管理",  
                            "state": "ENABLE",  
                            "sort": 1,  
                            "value": null,  
                            "type": "NONE",  
                            "discription": "用于用户管理的菜单",  
                            "createUserId": 1  
                        },  
                        "childs": [  
                            {  
                                "entity": {  
                                    "id": 7,  
                                    "parentMenuId": 6,  
                                    "name": "accountManage",  
                                    "icon": "el-icon-phone-outline\r\n",  
                                    "alias": "帐号管理",  
                                    "state": "ENABLE",  
                                    "sort": 0,  
                                    "value": "",  
                                    "type": "NONE",  
                                    "discription": "用于帐号管理的菜单",  
                                    "createUserId": 1  
                                },  
                                "childs": [  
                                    {  
                                        "entity": {  
                                            "id": 14,  
                                            "parentMenuId": 7,  
                                            "name": "emailManage",  
                                            "icon": "el-icon-sold-out\r\n",  
                                            "alias": "邮箱管理",  
                                            "state": "ENABLE",  
                                            "sort": 0,  
                                            "value": "/content/email",  
                                            "type": "LINK",  
                                            "discription": "用于邮箱管理的菜单",  
                                            "createUserId": 1  
                                        },  
                                        "childs": null  
                                    },  
                                    {  
                                        "entity": {  
                                            "id": 13,  
                                            "parentMenuId": 7,  
                                            "name": "passManage",  
                                            "icon": "el-icon-service\r\n",  
                                            "alias": "密码管理",  
                                            "state": "ENABLE",  
                                            "sort": 1,  
                                            "value": "/content/pass",  
                                            "type": "LINK",  
                                            "discription": "用于密码管理的菜单",  
                                            "createUserId": 1  
                                        },  
                                        "childs": null  
                                    }  
                                ]  
                            },  
                            {  
                                "entity": {  
                                    "id": 8,  
                                    "parentMenuId": 6,  
                                    "name": "integralManage",  
                                    "icon": "el-icon-picture",  
                                    "alias": "积分管理",  
                                    "state": "ENABLE",  
                                    "sort": 1,  
                                    "value": "/user/integral",  
                                    "type": "LINK",  
                                    "discription": "用于积分管理的菜单",  
                                    "createUserId": 1  
                                },  
                                "childs": null  
                            }  
                        ]  
                    },  
                    {  
                        "entity": {  
                            "id": 9,  
                            "parentMenuId": 0,  
                            "name": "contentManage",  
                            "icon": "el-icon-rank",  
                            "alias": "内容管理",  
                            "state": "ENABLE",  
                            "sort": 2,  
                            "value": null,  
                            "type": "NONE",  
                            "discription": "用于内容管理的菜单",  
                            "createUserId": 1  
                        },  
                        "childs": [  
                            {  
                                "entity": {  
                                    "id": 10,  
                                    "parentMenuId": 9,  
                                    "name": "classifyManage",  
                                    "icon": "el-icon-printer",  
                                    "alias": "分类管理",  
                                    "state": "ENABLE",  
                                    "sort": 0,  
                                    "value": "/content/classify",  
                                    "type": "LINK",  
                                    "discription": "用于分类管理的菜单",  
                                    "createUserId": 1  
                                },  
                                "childs": null  
                            },  
                            {  
                                "entity": {  
                                    "id": 11,  
                                    "parentMenuId": 9,  
                                    "name": "articleManage",  
                                    "icon": "el-icon-star-on",  
                                    "alias": "文章管理",  
                                    "state": "ENABLE",  
                                    "sort": 1,  
                                    "value": "/content/article",  
                                    "type": "LINK",  
                                    "discription": "用于文章管理的菜单",  
                                    "createUserId": 1  
                                },  
                                "childs": null  
                            },  
                            {  
                                "entity": {  
                                    "id": 12,  
                                    "parentMenuId": 9,  
                                    "name": "commentManage",  
                                    "icon": "el-icon-share",  
                                    "alias": "评论管理",  
                                    "state": "ENABLE",  
                                    "sort": 2,  
                                    "value": "/content/comment",  
                                    "type": "LINK",  
                                    "discription": "用于评论管理的菜单",  
                                    "createUserId": 1  
                                },  
                                "childs": null  
                            }  
                        ]  
                    }  
                ]  
            }  
        }
    },
    methods: {
      handleOpen(key, keyPath) {
        console.log(key, keyPath);
        console.log(this.id);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      },
      ItemClick(answerId){
          this.$router.push(`/singleQustion/${answerId}`);
      }
    },
    components:{
        Search,
    }
}
</script>
<style lang="scss" scoped>
#single{
    background-color: #F3F3F3;
    .search-wrap{
        height: 82px;    
        background-color: #fff;
        border-bottom: 1px solid #cfcfcf;
        > .center{
            line-height: 82px;
            padding-top: 17px;

        }
    }
    .center{
        width: 1200px;
        margin:0 auto;
        box-sizing: border-box;
    }
    .single-content{
        margin-top: 26px;       
        background-color: #f3f3f3; 
        .slider-bar{
            width: 266px;
            border: 1px solid #b3b3b3;
            margin-right: 24px;           
            .single-title{        
                height: 56px;
                line-height: 56px;
                padding-left:18px; 
                font-size: 22px;
                font-weight: normal;
                background-color: #fff;
            }
        }

    }
}

</style>


